The invention generally relates to the field of optical character recognition (OCR). More particularly, the invention provides a method and system architecture for optical character recognition which employs syntax and semantics information relating to the characters to be recognized, to improve recognition accuracy and confidence.
The problem at hand is to recognize the textual information contained in a scanned image. The scanned images can come from a wide variety of source material, such as written answers to printed questions on forms, or mailing addresses on postal envelopes.
OCR systems employ various strategies for isolating small portions of the image (such as groups of numeric digits within telephone numbers or ZIP codes) as connected components, segmenting a connected component into one or several character images and recognizing each such image as representing a specific character.
The process of OCR is prone to errors. Therefore an OCR system may be designed to identify several alternatives for segmenting a connected component, and several character choices for each character inside a segmentation alternative. The results are typically provided from the output of the OCR system to an application program, such as a text processor or a printer driver.
Conventional OCR recognition engines exist, which recognize characters with a reasonable accurracy. However, even a 90% accuracy rate at the character level means less than 50% at the word level, so over half of all words contain at least one error.
It is well known that the use of context information in conjunction with OCR helps to improve the level of accuracy realized. For instance, if a connected component is identified as a ZIP code (which consists only of numeric characters), then any character choice within the connected component which is not a numeric character can be dismissed as an incorrect choice.
In conventional systems, the OCR subsystem simply provides any character choices it recognizes to the application program, and the exploitation of context is performed by the application program. However, there are drawbacks in such an approach.
If an OCR system scans an image and outputs a single choice for each scanned character, then the application program can try alternate character values for well known confusion possibilities (i and l, O and D, 3 and 5, etc.), or use a fuzzy search to find the best matching word in a dictionary. If the engine returns several choices, then the application program may try to find the most likely sequence of characters based on maximizing some total confidence estimate. But this is by no means an easy task; and it is inefficient use of programming resources to include, within application programs, the necessary logic and code for each particular application. Therefore, there is a need to relieve application programs of the responsibility for performing context-based checking of OCR results.
It therefore is an object of the present invention to provide an OCR system which performs its own context-based checking, to improve recognition accuracy.
To achieve this and other objectives, there is provided in accordance with the invention a system architecture for an OCR system including a general purpose, highly customizable, context analyzer. Once the initial scan of the input image to be recognized has been made, the tentatively identified characters are subjected to a context analysis, in which rules of syntax and semantics are applied in order to verify that the scanned characters are consistent with those rules, thereby improving the confidence level that the recognized characters are indeed correct.
Since the constraints are application-dependent, there is preferably a means for customizing the analyzer. In accordance with the invention, this is done through a language called Document Specification Language (DSL). A program, or xe2x80x9cspecification,xe2x80x9d written in the Document Specification Language specifies both the syntax and the semantics of the information to be recognized. DSL is specialized, concise, and non-procedural. Its inherent search mechanism makes it a high level language. Once a specification for a given type of text to be recognized is written in DSL, the specification can be compiled into an internal representation (the context structure).
While the invention is primarily disclosed as a system, it will be understood by a person of ordinary skill in the art that a method, such as a method executable on a conventional data processor, including a CPU, memory, I/O, program storage, a connecting bus, and other appropriate components, could be programmed or otherwise designed to facilitate the practice of the method of the invention. Such a method would include appropriate method steps for performing the invention. Also, an article of manufacture, such as a pre-recorded disk or other similar computer program product, for use with a data processing system, could include a storage medium and program means recorded thereon for directing the data processing system to facilitate the practice of the method of the invention. It will be understood that such apparatus and articles of manufacture also fall within the spirit and scope of the invention.